package fun.stgoder.dev.listener.common.face2;

import cn.hutool.crypto.SecureUtil;

/**
 * <Description> <br>
 *
 * @author caixing<br>
 * @version 1.0<br>
 * @taskId <br>
 * @CreateDate 2019/8/13 15:50 <br>
 */
public class CommonUtils {


    /**
     * 私有化工具类，避免实例化
     */
    private CommonUtils() {
    }

    /**
     * 生成token
     *
     * @param appKey    应用标识
     * @param timestamp 当前时间戳
     * @param appSecret 应用密钥
     * @return
     */
    public static String generateToken(String appKey, long timestamp, String appSecret) {
        try {
            return SecureUtil.md5((appKey
                    + "{" + appSecret + ":" + timestamp + "}"));
        } catch (Exception e) {
            return null;
        }
    }

}
